import turtle

a = True
b = False

turtle.hideturtle()
# 画电路板
turtle.pencolor('orange')
turtle.pensize(4)
turtle.goto(150, 0)
turtle.goto(150, 180)
turtle.goto(-150, 180)
turtle.goto(-150, 0)
turtle.goto(0, 0)

# 画电池
turtle.fillcolor('green')
turtle.begin_fill()
turtle.goto(0, 15)
turtle.goto(-75, 15)
turtle.goto(-75, -15)
turtle.goto(0, -15)
turtle.goto(0, 0)
turtle.end_fill()

# 画灯泡
turtle.penup()
turtle.goto(0, 180)
if a or b:
    turtle.dot(50, 'yellow')
else:
    turtle.dot(50, 'black')
turtle.pendown()

turtle.done()
